package com.itheima.myreflect2.Student.test1.test2;

/**
 * @program: Myset
 * @description:
 * @author: xuejingjing
 * @create: 2021-06-13 19:23
 **/
public class TestLamdba3 {
    public static void main(String[] args) {
        System.out.println(useCalcau((int a, int b) -> {
            return a + b;
        }));


        System.out.println(useCalcau(new Calcu() {
            @Override
            public int calc(int a, int b) {
                return a + b;
            }
        }));

    }


    public static int useCalcau(Calcu calcu){
       return calcu.calc(10, 20);
    }
}



//接口的写法都不熟练
interface Calcu{
    int calc(int a,int b);
}
